# 定义 mcp 工具
def mcp_tool_func():
    def take_photo(data) -> tuple[bytes, bool]:
        # 实现拍照功能
        with open("../file/image/leijun.jpg", "rb") as f:
            return f.read(), False

    def get_device_status(data) -> tuple[dict, bool]:
        # 实现获取设备状态功能
        return {
            "audio_speaker": {"volume": 80},
            "screen": {"brightness": 75, "theme": "light"},
            "network": {"type": "wifi", "ssid": "wifi名称", "signal": "strong"},
        }, False

    def set_volume(data) -> tuple[dict, bool]:
        # 实现设置音量功能
        return {}, False

    # 返回工具函数映射
    return {
        "set_volume": set_volume,
        "get_device_status": get_device_status,
        "take_photo": take_photo,
    }
